# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        潘炎珍  
# Name:         demo05
# Description:
# Author:       98745
# Date:         2019/3/14
#-------------------------------------------------------------------------------

import pandas
df=pandas.read_csv('gapminder.tsv',sep='\t')
print(df.groupby('year')['lifeExp'].mean().head(3))
print('------------')
multi_group_var=df.groupby(['year','continent'])[['lifeExp','gdpPercap']].mean().head(3)
print(multi_group_var)
print('------------')
print(multi_group_var.reset_index())
print('----------------')
print(df.groupby('continent')['country'].nunique())